package cn.dansj.service;

import com.xxl.job.entity.Connection;
import org.springframework.data.domain.Page;

import java.util.List;

public interface ConnectionService {

    //页面查询
    Page<Connection> search(Integer pageNum,
                            Integer pageLimit,
                            String name,
                            String connection_info,
                            String status);

    Connection getConnectionBySequence(String sequence);

    List<Connection> getConnectionByDbType(String dbType);

    //更新连接状态和监控状态
    void updateConnectionStatus(String sequence, String monitor, String status);

    //校验监控状态
    int getMonitor(String sequence);

    List<Connection> getMonitor();

    void save(Connection connection);

    void save(List<Connection> connections);

    //获取所有连接信息
    List<Connection> getAll();

    //通过名称获取连接信息
    Connection getConnectionByName(String name);

    List<Connection> getConnectionsByDbTypes(List<String> dbTypes);

}
